# frozen_string_literal: true

module Types
  class MergeRequestDiffType < ::Types::BaseObject
    graphql_name 'MergeRequestDiff'
    description 'A diff version of a merge request.'

    authorize :read_merge_request

    field :diff_llm_summary, ::Types::MergeRequests::DiffLlmSummaryType,
      null: true,
      method: :merge_request_diff_llm_summary,
      description: 'Diff summary generated by AI.'

    field :review_llm_summaries, ::Types::MergeRequests::ReviewLlmSummaryType.connection_type,
      null: true,
      method: :merge_request_review_llm_summaries,
      description: 'Review summaries generated by AI.'

    field :created_at, Types::TimeType,
      null: false,
      description: 'Timestamp of when the diff was created.'

    field :updated_at, Types::TimeType,
      null: false,
      description: 'Timestamp of when the diff was updated.'
  end
end
